/*
 * VCRErrorAdapter.java
 *
 * Created on January 5, 2006, 2:14 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.mbari.vcr;

import org.mbari.util.IObserver;
import org.mbari.util.ObservableSupport;

/**
 *
 * @author brian
 */
public class VCRErrorAdapter implements IVCRError {
    
    /**
	 * @uml.property  name="oc"
	 * @uml.associationEnd  multiplicity="(1 1)"
	 */
    private ObservableSupport oc = new ObservableSupport();
    
    /** Creates a new instance of VCRErrorAdapter */
    public VCRErrorAdapter() {
    }


    /** Notifies all the observers of a chage of state */
    protected void notifyObservers() {
        oc.notify(this, null);
    }

    /** Removes all observers from the notfication list */
    public void removeAllObservers() {
        oc.clear();
    }

    /**
     * Remove an observer from the notification list
     *
     * @param observer
     */
    public void removeObserver(IObserver observer) {
        oc.remove(observer);
    }

    public int getError() {
        return OK;
    }

    public boolean isChecksumError() {
        return false;
    }

    public boolean isFramingError() {
        return false;
    }

    public boolean isOK() {
        return true;
    }

    public boolean isOverrunError() {
        return false;
    }

    public boolean isParityError() {
        return false;
    }

    public boolean isTimeout() {
        return false;
    }

    public boolean isUndefinedCommand() {
        return false;
    }

    public void addObserver(IObserver observer) {
        oc.add(observer);
    }
    
}
